package jlib.component.tool.skin.points.decorator {
	
	import jlib.core.graphic.DrawCurve;
	
	import flash.display.DisplayObject;
	import flash.display.Graphics;
	import flash.display.Shape;
	import flash.geom.Point;

	/**
	 * @author 박종희
	 */
	internal final class Drawer {
			
		static public function moveCursor($graphics:Graphics): void
		{
			$graphics.beginFill(0);
			$graphics.lineStyle(1, 0xFFFFFF);
			$graphics.moveTo(1, 1);
			$graphics.lineTo(1, -2);
			$graphics.lineTo(-1, -2);
			$graphics.lineTo(2, -6);
			$graphics.lineTo(5, -2);
			$graphics.lineTo(3, -2);
			$graphics.lineTo(3, 1);
			// right arrow
			$graphics.lineTo(6, 1);
			$graphics.lineTo(6, -1);
			$graphics.lineTo(10, 2);
			$graphics.lineTo(6, 5);
			$graphics.lineTo(6, 3);
			$graphics.lineTo(3, 3);
			// down arrow
			$graphics.lineTo(3, 5);
			$graphics.lineTo(3, 6);
			$graphics.lineTo(5, 6);
			$graphics.lineTo(2, 10);
			$graphics.lineTo(-1, 6);
			$graphics.lineTo(1, 6);
			$graphics.lineTo(1, 5);
			// left arrow
			$graphics.lineTo(1, 3);
			$graphics.lineTo(-2, 3);
			$graphics.lineTo(-2, 5);
			$graphics.lineTo(-6, 2);
			$graphics.lineTo(-2, -1);
			$graphics.lineTo(-2, 1);
			$graphics.lineTo(1, 1);
			$graphics.endFill();
		}
		
		static public function rotateCursor($graphics:Graphics): void 
		{
			$graphics.beginFill(0);
			$graphics.lineStyle(1, 0xFFFFFF);
			var angle1:Number = Math.PI;
			var angle2:Number = -Math.PI/ 2;
			DrawCurve.drawArc($graphics,0,0,4, angle1, angle2);
			DrawCurve.drawArc($graphics,0,0,6, angle2, angle1, false);
			// arrow
			$graphics.lineTo(-8, 0);
			$graphics.lineTo(-5, 4);
			$graphics.lineTo(-2, 0);
			$graphics.lineTo(-4, 0);
			$graphics.endFill();
		}
		
		static public function skewCursor($graphics:Graphics): void 
		{ 
			$graphics.beginFill(0);
			$graphics.lineStyle(1, 0xFFFFFF);
			// right arrow
			$graphics.moveTo(-6, -1);
			$graphics.lineTo(6, -1);
			$graphics.lineTo(6, -4);
			$graphics.lineTo(10, 1);
			$graphics.lineTo(-6, 1);
			$graphics.lineTo(-6, -1);
			$graphics.endFill();
			// left arrow
			$graphics.beginFill(0);
			$graphics.lineStyle(1, 0xFFFFFF);
			$graphics.moveTo(10, 5);
			$graphics.lineTo(-2, 5);
			$graphics.lineTo(-2, 8);
			$graphics.lineTo(-6, 3);
			$graphics.lineTo(10, 3);
			$graphics.lineTo(10, 5);
			$graphics.endFill();
		}
		
		static public function scaleCursor($graphics:Graphics): void 
		{ 
			$graphics.beginFill(0);
			$graphics.lineStyle(1, 0xFFFFFF);
			$graphics.moveTo(4.5, -0.5);
			$graphics.lineTo(4.5, -2.5);
			$graphics.lineTo(8.5, 0.5);
			$graphics.lineTo(4.5, 3.5);
			$graphics.lineTo(4.5, 1.5);
			$graphics.lineTo(-0.5, 1.5);
			// left arrow
			$graphics.lineTo(-3.5, 1.5);
			$graphics.lineTo(-3.5, 3.5);
			$graphics.lineTo(-7.5, 0.5);
			$graphics.lineTo(-3.5, -2.5);
			$graphics.lineTo(-3.5, -0.5);
			$graphics.lineTo(4.5, -0.5);
			$graphics.endFill();
		}
		
		static public function triangle($graphics:Graphics, $cx:Number, $cy:Number, $radius:Number, $rotate:Number): void
		{
			var point0:Point = Point.polar($radius, Math.PI*2/3*0+$rotate);
			var point1:Point = Point.polar($radius, Math.PI*2/3*1+$rotate);
			var point2:Point = Point.polar($radius, Math.PI*2/3*2+$rotate);
			
			point0.x += $cx;
			point0.y += $cy;
			point1.x += $cx;
			point1.y += $cy;
			point2.x += $cx;
			point2.y += $cy;
			
			$graphics.moveTo(point0.x, point0.y);
			$graphics.lineTo(point1.x, point1.y);
			$graphics.lineTo(point2.x, point2.y);
			$graphics.lineTo(point0.x, point0.y);
		}	
		
	}//c
}
